﻿using System.Diagnostics;
using System.Windows.Input;
using Fluffy.Library.Mvvm;
using System;
using System.Reflection;

namespace Fluffy.Viewes
{
	public class AboutViewModel : ViewModelBase
	{
		public Version Version
		{
			get { return Assembly.GetExecutingAssembly().GetName().Version; }
		}

		public string AssemblyCopyright
		{
			get
			{
				object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
				if (attributes.Length == 0)
				{
					return "";
				}
				return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
			}
		}

		public ICommand WebsiteCommand
		{
			get { return new Command(OnWebsite); }
		}

		private static void OnWebsite()
		{
			Process.Start("http://fluffy.codeplex.com/");
		}
	}
}
